home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database Designers / Rational Rose 2000 / Rational Setup.EXE / common / lib / Win32 / OLE / NLS.pm < prev    next >
Text File  |  1998-11-15  |  30KB  |  919 lines

  1. # The documentation is at the __END__
  2.  
  3. package Win32::OLE::NLS;
  4. require Win32::OLE;  # Make sure the XS bootstrap has been called
  5.  
  6. use strict;
  7. use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS @ISA);
  8.  
  9. use Exporter;
  10. @ISA = qw(Exporter);
  11.  
  12. @EXPORT = qw(
  13.          CompareString
  14.          LCMapString
  15.          GetLocaleInfo
  16.          GetStringType
  17.          GetSystemDefaultLangID
  18.          GetSystemDefaultLCID
  19.          GetUserDefaultLangID
  20.          GetUserDefaultLCID
  21.  
  22.          MAKELANGID
  23.          PRIMARYLANGID
  24.          SUBLANGID
  25.          LANG_SYSTEM_DEFAULT
  26.          LANG_USER_DEFAULT
  27.          MAKELCID
  28.          LANGIDFROMLCID
  29.          LOCALE_SYSTEM_DEFAULT
  30.          LOCALE_USER_DEFAULT
  31.         );
  32.  
  33. %EXPORT_TAGS = 
  34. (
  35.  CT     => [qw(CT_CTYPE1 CT_CTYPE2 CT_CTYPE3)],
  36.  C1     => [qw(C1_UPPER C1_LOWER C1_DIGIT C1_SPACE C1_PUNCT
  37.         C1_CNTRL C1_BLANK C1_XDIGIT C1_ALPHA)],
  38.  C2     => [qw(C2_LEFTTORIGHT C2_RIGHTTOLEFT C2_EUROPENUMBER
  39.         C2_EUROPESEPARATOR C2_EUROPETERMINATOR C2_ARABICNUMBER
  40.         C2_COMMONSEPARATOR C2_BLOCKSEPARATOR C2_SEGMENTSEPARATOR
  41.         C2_WHITESPACE C2_OTHERNEUTRAL C2_NOTAPPLICABLE)],
  42.  C3     => [qw(C3_NONSPACING C3_DIACRITIC C3_VOWELMARK C3_SYMBOL C3_KATAKANA
  43.         C3_HIRAGANA C3_HALFWIDTH C3_FULLWIDTH C3_IDEOGRAPH C3_KASHIDA
  44.         C3_ALPHA C3_NOTAPPLICABLE)],
  45.  NORM     => [qw(NORM_IGNORECASE NORM_IGNORENONSPACE NORM_IGNORESYMBOLS
  46.         NORM_IGNOREWIDTH NORM_IGNOREKANATYPE NORM_IGNOREKASHIDA)],
  47.  LCMAP     => [qw(LCMAP_LOWERCASE LCMAP_UPPERCASE LCMAP_SORTKEY LCMAP_HALFWIDTH
  48.         LCMAP_FULLWIDTH LCMAP_HIRAGANA LCMAP_KATAKANA)],
  49.  LANG     => [qw(LANG_NEUTRAL LANG_ALBANIAN LANG_ARABIC LANG_BAHASA
  50.         LANG_BULGARIAN LANG_CATALAN LANG_CHINESE LANG_CZECH LANG_DANISH
  51.         LANG_DUTCH LANG_ENGLISH LANG_FINNISH LANG_FRENCH LANG_GERMAN
  52.         LANG_GREEK LANG_HEBREW LANG_HUNGARIAN LANG_ICELANDIC
  53.         LANG_ITALIAN LANG_JAPANESE LANG_KOREAN LANG_NORWEGIAN
  54.         LANG_POLISH LANG_PORTUGUESE LANG_RHAETO_ROMAN LANG_ROMANIAN
  55.         LANG_RUSSIAN LANG_SERBO_CROATIAN LANG_SLOVAK LANG_SPANISH 
  56.         LANG_SWEDISH LANG_THAI LANG_TURKISH LANG_URDU)],
  57.  SUBLANG => [qw(SUBLANG_NEUTRAL SUBLANG_DEFAULT SUBLANG_SYS_DEFAULT
  58.         SUBLANG_CHINESE_SIMPLIFIED SUBLANG_CHINESE_TRADITIONAL
  59.         SUBLANG_DUTCH SUBLANG_DUTCH_BELGIAN SUBLANG_ENGLISH_US
  60.         SUBLANG_ENGLISH_UK SUBLANG_ENGLISH_AUS SUBLANG_ENGLISH_CAN
  61.         SUBLANG_ENGLISH_NZ SUBLANG_ENGLISH_EIRE SUBLANG_FRENCH
  62.         SUBLANG_FRENCH_BELGIAN SUBLANG_FRENCH_CANADIAN
  63.         SUBLANG_FRENCH_SWISS SUBLANG_GERMAN SUBLANG_GERMAN_SWISS
  64.         SUBLANG_GERMAN_AUSTRIAN SUBLANG_ITALIAN SUBLANG_ITALIAN_SWISS
  65.         SUBLANG_NORWEGIAN_BOKMAL SUBLANG_NORWEGIAN_NYNORSK
  66.         SUBLANG_PORTUGUESE SUBLANG_PORTUGUESE_BRAZILIAN
  67.         SUBLANG_SERBO_CROATIAN_CYRILLIC SUBLANG_SERBO_CROATIAN_LATIN
  68.         SUBLANG_SPANISH SUBLANG_SPANISH_MEXICAN
  69.         SUBLANG_SPANISH_MODERN)],
  70.  CTRY     => [qw(CTRY_DEFAULT CTRY_AUSTRALIA CTRY_AUSTRIA CTRY_BELGIUM
  71.         CTRY_BRAZIL CTRY_CANADA CTRY_DENMARK CTRY_FINLAND CTRY_FRANCE
  72.         CTRY_GERMANY CTRY_ICELAND CTRY_IRELAND CTRY_ITALY CTRY_JAPAN
  73.         CTRY_MEXICO CTRY_NETHERLANDS CTRY_NEW_ZEALAND CTRY_NORWAY
  74.         CTRY_PORTUGAL CTRY_PRCHINA CTRY_SOUTH_KOREA CTRY_SPAIN
  75.         CTRY_SWEDEN CTRY_SWITZERLAND CTRY_TAIWAN CTRY_UNITED_KINGDOM
  76.         CTRY_UNITED_STATES)],
  77.  LOCALE     => [qw(LOCALE_NOUSEROVERRIDE LOCALE_ILANGUAGE LOCALE_SLANGUAGE
  78.         LOCALE_SENGLANGUAGE LOCALE_SABBREVLANGNAME
  79.         LOCALE_SNATIVELANGNAME LOCALE_ICOUNTRY LOCALE_SCOUNTRY
  80.         LOCALE_SENGCOUNTRY LOCALE_SABBREVCTRYNAME LOCALE_SNATIVECTRYNAME
  81.         LOCALE_IDEFAULTLANGUAGE LOCALE_IDEFAULTCOUNTRY
  82.         LOCALE_IDEFAULTCODEPAGE LOCALE_IDEFAULTANSICODEPAGE LOCALE_SLIST
  83.         LOCALE_IMEASURE LOCALE_SDECIMAL LOCALE_STHOUSAND
  84.         LOCALE_SGROUPING LOCALE_IDIGITS LOCALE_ILZERO LOCALE_INEGNUMBER
  85.         LOCALE_SNATIVEDIGITS LOCALE_SCURRENCY LOCALE_SINTLSYMBOL
  86.         LOCALE_SMONDECIMALSEP LOCALE_SMONTHOUSANDSEP LOCALE_SMONGROUPING
  87.         LOCALE_ICURRDIGITS LOCALE_IINTLCURRDIGITS LOCALE_ICURRENCY
  88.         LOCALE_INEGCURR LOCALE_SDATE LOCALE_STIME LOCALE_SSHORTDATE
  89.         LOCALE_SLONGDATE LOCALE_STIMEFORMAT LOCALE_IDATE LOCALE_ILDATE
  90.         LOCALE_ITIME LOCALE_ITIMEMARKPOSN LOCALE_ICENTURY LOCALE_ITLZERO
  91.         LOCALE_IDAYLZERO LOCALE_IMONLZERO LOCALE_S1159 LOCALE_S2359
  92.         LOCALE_ICALENDARTYPE LOCALE_IOPTIONALCALENDAR
  93.         LOCALE_IFIRSTDAYOFWEEK LOCALE_IFIRSTWEEKOFYEAR LOCALE_SDAYNAME1
  94.         LOCALE_SDAYNAME2 LOCALE_SDAYNAME3 LOCALE_SDAYNAME4
  95.         LOCALE_SDAYNAME5 LOCALE_SDAYNAME6 LOCALE_SDAYNAME7
  96.         LOCALE_SABBREVDAYNAME1 LOCALE_SABBREVDAYNAME2
  97.         LOCALE_SABBREVDAYNAME3 LOCALE_SABBREVDAYNAME4
  98.         LOCALE_SABBREVDAYNAME5 LOCALE_SABBREVDAYNAME6
  99.         LOCALE_SABBREVDAYNAME7 LOCALE_SMONTHNAME1 LOCALE_SMONTHNAME2
  100.         LOCALE_SMONTHNAME3 LOCALE_SMONTHNAME4 LOCALE_SMONTHNAME5
  101.         LOCALE_SMONTHNAME6 LOCALE_SMONTHNAME7 LOCALE_SMONTHNAME8
  102.         LOCALE_SMONTHNAME9 LOCALE_SMONTHNAME10 LOCALE_SMONTHNAME11
  103.         LOCALE_SMONTHNAME12 LOCALE_SMONTHNAME13 LOCALE_SABBREVMONTHNAME1
  104.         LOCALE_SABBREVMONTHNAME2 LOCALE_SABBREVMONTHNAME3
  105.         LOCALE_SABBREVMONTHNAME4 LOCALE_SABBREVMONTHNAME5
  106.         LOCALE_SABBREVMONTHNAME6 LOCALE_SABBREVMONTHNAME7
  107.         LOCALE_SABBREVMONTHNAME8 LOCALE_SABBREVMONTHNAME9
  108.         LOCALE_SABBREVMONTHNAME10 LOCALE_SABBREVMONTHNAME11
  109.         LOCALE_SABBREVMONTHNAME12 LOCALE_SABBREVMONTHNAME13
  110.         LOCALE_SPOSITIVESIGN LOCALE_SNEGATIVESIGN LOCALE_IPOSSIGNPOSN
  111.         LOCALE_INEGSIGNPOSN LOCALE_IPOSSYMPRECEDES LOCALE_IPOSSEPBYSPACE
  112.         LOCALE_INEGSYMPRECEDES LOCALE_INEGSEPBYSPACE)]
  113. );
  114.  
  115. foreach my $tag (keys %EXPORT_TAGS) {
  116.     push @EXPORT_OK, @{$EXPORT_TAGS{$tag}};
  117. }
  118.  
  119. # Character Type Flags
  120. sub CT_CTYPE1                       { 0x0001; }
  121. sub CT_CTYPE2                       { 0x0002; }
  122. sub CT_CTYPE3                       { 0x0004; }
  123.  
  124. # Character Type 1 Bits
  125. sub C1_UPPER                        { 0x0001; }
  126. sub C1_LOWER                        { 0x0002; }
  127. sub C1_DIGIT                        { 0x0004; }
  128. sub C1_SPACE                        { 0x0008; }
  129. sub C1_PUNCT                        { 0x0010; }
  130. sub C1_CNTRL                        { 0x0020; }
  131. sub C1_BLANK                        { 0x0040; }
  132. sub C1_XDIGIT                       { 0x0080; }
  133. sub C1_ALPHA                        { 0x0100; }
  134.  
  135. # Character Type 2 Bits
  136. sub C2_LEFTTORIGHT                  { 0x1; }
  137. sub C2_RIGHTTOLEFT                  { 0x2; }
  138. sub C2_EUROPENUMBER                 { 0x3; }
  139. sub C2_EUROPESEPARATOR              { 0x4; }
  140. sub C2_EUROPETERMINATOR             { 0x5; }
  141. sub C2_ARABICNUMBER                 { 0x6; }
  142. sub C2_COMMONSEPARATOR              { 0x7; }
  143. sub C2_BLOCKSEPARATOR               { 0x8; }
  144. sub C2_SEGMENTSEPARATOR             { 0x9; }
  145. sub C2_WHITESPACE                   { 0xA; }
  146. sub C2_OTHERNEUTRAL                 { 0xB; }
  147. sub C2_NOTAPPLICABLE                { 0x0; }
  148.  
  149. # Character Type 3 Bits
  150. sub C3_NONSPACING                   { 0x0001; }
  151. sub C3_DIACRITIC                    { 0x0002; }
  152. sub C3_VOWELMARK                    { 0x0004; }
  153. sub C3_SYMBOL                       { 0x0008; }
  154. sub C3_KATAKANA                     { 0x0010; }
  155. sub C3_HIRAGANA                     { 0x0020; }
  156. sub C3_HALFWIDTH                    { 0x0040; }
  157. sub C3_FULLWIDTH                    { 0x0080; }
  158. sub C3_IDEOGRAPH                    { 0x0100; }
  159. sub C3_KASHIDA                      { 0x0200; }
  160. sub C3_ALPHA                        { 0x8000; }
  161. sub C3_NOTAPPLICABLE                { 0x0; }
  162.  
  163. # String Flags
  164. sub NORM_IGNORECASE                 { 0x0001; }
  165. sub NORM_IGNORENONSPACE             { 0x0002; }
  166. sub NORM_IGNORESYMBOLS              { 0x0004; }
  167. sub NORM_IGNOREWIDTH                { 0x0008; }
  168. sub NORM_IGNOREKANATYPE             { 0x0040; }
  169. sub NORM_IGNOREKASHIDA              { 0x40000;}
  170.  
  171. # Locale Dependent Mapping Flags
  172. sub LCMAP_LOWERCASE                 { 0x0100; }
  173. sub LCMAP_UPPERCASE                 { 0x0200; }
  174. sub LCMAP_SORTKEY                   { 0x0400; }
  175. sub LCMAP_HALFWIDTH                 { 0x0800; }
  176. sub LCMAP_FULLWIDTH                 { 0x1000; }
  177. sub LCMAP_HIRAGANA                  { 0x2000; }
  178. sub LCMAP_KATAKANA                  { 0x4000; }
  179.  
  180. # Primary Language Identifier
  181. sub LANG_NEUTRAL                    { 0x00; }
  182. sub LANG_ALBANIAN                   { 0x1c; }
  183. sub LANG_ARABIC                     { 0x01; }
  184. sub LANG_BAHASA                     { 0x21; }
  185. sub LANG_BULGARIAN                  { 0x02; }
  186. sub LANG_CATALAN                    { 0x03; }
  187. sub LANG_CHINESE                    { 0x04; }
  188. sub LANG_CZECH                      { 0x05; }
  189. sub LANG_DANISH                     { 0x06; }
  190. sub LANG_DUTCH                      { 0x13; }
  191. sub LANG_ENGLISH                    { 0x09; }
  192. sub LANG_FINNISH                    { 0x0b; }
  193. sub LANG_FRENCH                     { 0x0c; }
  194. sub LANG_GERMAN                     { 0x07; }
  195. sub LANG_GREEK                      { 0x08; }
  196. sub LANG_HEBREW                     { 0x0d; }
  197. sub LANG_HUNGARIAN                  { 0x0e; }
  198. sub LANG_ICELANDIC                  { 0x0f; }
  199. sub LANG_ITALIAN                    { 0x10; }
  200. sub LANG_JAPANESE                   { 0x11; }
  201. sub LANG_KOREAN                     { 0x12; }
  202. sub LANG_NORWEGIAN                  { 0x14; }
  203. sub LANG_POLISH                     { 0x15; }
  204. sub LANG_PORTUGUESE                 { 0x16; }
  205. sub LANG_RHAETO_ROMAN               { 0x17; }
  206. sub LANG_ROMANIAN                   { 0x18; }
  207. sub LANG_RUSSIAN                    { 0x19; }
  208. sub LANG_SERBO_CROATIAN             { 0x1a; }
  209. sub LANG_SLOVAK                     { 0x1b; }
  210. sub LANG_SPANISH                    { 0x0a; }
  211. sub LANG_SWEDISH                    { 0x1d; }
  212. sub LANG_THAI                       { 0x1e; }
  213. sub LANG_TURKISH                    { 0x1f; }
  214. sub LANG_URDU                       { 0x20; }
  215.  
  216. # Sublanguage Identifier
  217. sub SUBLANG_NEUTRAL                 { 0x00; }
  218. sub SUBLANG_DEFAULT                 { 0x01; }
  219. sub SUBLANG_SYS_DEFAULT             { 0x02; }
  220. sub SUBLANG_CHINESE_SIMPLIFIED      { 0x02; }
  221. sub SUBLANG_CHINESE_TRADITIONAL     { 0x01; }
  222. sub SUBLANG_DUTCH                   { 0x01; }
  223. sub SUBLANG_DUTCH_BELGIAN           { 0x02; }
  224. sub SUBLANG_ENGLISH_US              { 0x01; }
  225. sub SUBLANG_ENGLISH_UK              { 0x02; }
  226. sub SUBLANG_ENGLISH_AUS             { 0x03; }
  227. sub SUBLANG_ENGLISH_CAN             { 0x04; }
  228. sub SUBLANG_ENGLISH_NZ              { 0x05; }
  229. sub SUBLANG_ENGLISH_EIRE            { 0x06; }
  230. sub SUBLANG_FRENCH                  { 0x01; }
  231. sub SUBLANG_FRENCH_BELGIAN          { 0x02; }
  232. sub SUBLANG_FRENCH_CANADIAN         { 0x03; }
  233. sub SUBLANG_FRENCH_SWISS            { 0x04; }
  234. sub SUBLANG_GERMAN                  { 0x01; }
  235. sub SUBLANG_GERMAN_SWISS            { 0x02; }
  236. sub SUBLANG_GERMAN_AUSTRIAN         { 0x03; }
  237. sub SUBLANG_ITALIAN                 { 0x01; }
  238. sub SUBLANG_ITALIAN_SWISS           { 0x02; }
  239. sub SUBLANG_NORWEGIAN_BOKMAL        { 0x01; }
  240. sub SUBLANG_NORWEGIAN_NYNORSK       { 0x02; }
  241. sub SUBLANG_PORTUGUESE              { 0x02; }
  242. sub SUBLANG_PORTUGUESE_BRAZILIAN    { 0x01; }
  243. sub SUBLANG_SERBO_CROATIAN_CYRILLIC { 0x02; }
  244. sub SUBLANG_SERBO_CROATIAN_LATIN    { 0x01; }
  245. sub SUBLANG_SPANISH                 { 0x01; }
  246. sub SUBLANG_SPANISH_MEXICAN         { 0x02; }
  247. sub SUBLANG_SPANISH_MODERN          { 0x03; }
  248.  
  249. # Country codes
  250. sub CTRY_DEFAULT                    { 0;   }
  251. sub CTRY_AUSTRALIA                  { 61;  }
  252. sub CTRY_AUSTRIA                    { 43;  }
  253. sub CTRY_BELGIUM                    { 32;  }
  254. sub CTRY_BRAZIL                     { 55;  }
  255. sub CTRY_CANADA                     { 2;   }
  256. sub CTRY_DENMARK                    { 45;  }
  257. sub CTRY_FINLAND                    { 358; }
  258. sub CTRY_FRANCE                     { 33;  }
  259. sub CTRY_GERMANY                    { 49;  }
  260. sub CTRY_ICELAND                    { 354; }
  261. sub CTRY_IRELAND                    { 353; }
  262. sub CTRY_ITALY                      { 39;  }
  263. sub CTRY_JAPAN                      { 81;  }
  264. sub CTRY_MEXICO                     { 52;  }
  265. sub CTRY_NETHERLANDS                { 31;  }
  266. sub CTRY_NEW_ZEALAND                { 64;  }
  267. sub CTRY_NORWAY                     { 47;  }
  268. sub CTRY_PORTUGAL                   { 351; }
  269. sub CTRY_PRCHINA                    { 86;  }
  270. sub CTRY_SOUTH_KOREA                { 82;  }
  271. sub CTRY_SPAIN                      { 34;  }
  272. sub CTRY_SWEDEN                     { 46;  }
  273. sub CTRY_SWITZERLAND                { 41;  }
  274. sub CTRY_TAIWAN                     { 886; }
  275. sub CTRY_UNITED_KINGDOM             { 44;  }
  276. sub CTRY_UNITED_STATES              { 1;   }
  277.  
  278. # Locale Types
  279. sub LOCALE_NOUSEROVERRIDE           { 0x80000000; }
  280. sub LOCALE_ILANGUAGE                { 0x0001; }
  281. sub LOCALE_SLANGUAGE                { 0x0002; }
  282. sub LOCALE_SENGLANGUAGE             { 0x1001; }
  283. sub LOCALE_SABBREVLANGNAME          { 0x0003; }
  284. sub LOCALE_SNATIVELANGNAME          { 0x0004; }
  285. sub LOCALE_ICOUNTRY                 { 0x0005; }
  286. sub LOCALE_SCOUNTRY                 { 0x0006; }
  287. sub LOCALE_SENGCOUNTRY              { 0x1002; }
  288. sub LOCALE_SABBREVCTRYNAME          { 0x0007; }
  289. sub LOCALE_SNATIVECTRYNAME          { 0x0008; }
  290. sub LOCALE_IDEFAULTLANGUAGE         { 0x0009; }
  291. sub LOCALE_IDEFAULTCOUNTRY          { 0x000A; }
  292. sub LOCALE_IDEFAULTCODEPAGE         { 0x000B; }
  293. sub LOCALE_IDEFAULTANSICODEPAGE     { 0x1004; }
  294. sub LOCALE_SLIST                    { 0x000C; }
  295. sub LOCALE_IMEASURE                 { 0x000D; }
  296. sub LOCALE_SDECIMAL                 { 0x000E; }
  297. sub LOCALE_STHOUSAND                { 0x000F; }
  298. sub LOCALE_SGROUPING                { 0x0010; }
  299. sub LOCALE_IDIGITS                  { 0x0011; }
  300. sub LOCALE_ILZERO                   { 0x0012; }
  301. sub LOCALE_INEGNUMBER               { 0x1010; }
  302. sub LOCALE_SNATIVEDIGITS            { 0x0013; }
  303. sub LOCALE_SCURRENCY                { 0x0014; }
  304. sub LOCALE_SINTLSYMBOL              { 0x0015; }
  305. sub LOCALE_SMONDECIMALSEP           { 0x0016; }
  306. sub LOCALE_SMONTHOUSANDSEP          { 0x0017; }
  307. sub LOCALE_SMONGROUPING             { 0x0018; }
  308. sub LOCALE_ICURRDIGITS              { 0x0019; }
  309. sub LOCALE_IINTLCURRDIGITS          { 0x001A; }
  310. sub LOCALE_ICURRENCY                { 0x001B; }
  311. sub LOCALE_INEGCURR                 { 0x001C; }
  312. sub LOCALE_SDATE                    { 0x001D; }
  313. sub LOCALE_STIME                    { 0x001E; }
  314. sub LOCALE_SSHORTDATE               { 0x001F; }
  315. sub LOCALE_SLONGDATE                { 0x0020; }
  316. sub LOCALE_STIMEFORMAT              { 0x1003; }
  317. sub LOCALE_IDATE                    { 0x0021; }
  318. sub LOCALE_ILDATE                   { 0x0022; }
  319. sub LOCALE_ITIME                    { 0x0023; }
  320. sub LOCALE_ITIMEMARKPOSN            { 0x1005; }
  321. sub LOCALE_ICENTURY                 { 0x0024; }
  322. sub LOCALE_ITLZERO                  { 0x0025; }
  323. sub LOCALE_IDAYLZERO                { 0x0026; }
  324. sub LOCALE_IMONLZERO                { 0x0027; }
  325. sub LOCALE_S1159                    { 0x0028; }
  326. sub LOCALE_S2359                    { 0x0029; }
  327. sub LOCALE_ICALENDARTYPE            { 0x1009; }
  328. sub LOCALE_IOPTIONALCALENDAR        { 0x100B; }
  329. sub LOCALE_IFIRSTDAYOFWEEK          { 0x100C; }
  330. sub LOCALE_IFIRSTWEEKOFYEAR         { 0x100D; }
  331. sub LOCALE_SDAYNAME1                { 0x002A; }
  332. sub LOCALE_SDAYNAME2                { 0x002B; }
  333. sub LOCALE_SDAYNAME3                { 0x002C; }
  334. sub LOCALE_SDAYNAME4                { 0x002D; }
  335. sub LOCALE_SDAYNAME5                { 0x002E; }
  336. sub LOCALE_SDAYNAME6                { 0x002F; }
  337. sub LOCALE_SDAYNAME7                { 0x0030; }
  338. sub LOCALE_SABBREVDAYNAME1          { 0x0031; }
  339. sub LOCALE_SABBREVDAYNAME2          { 0x0032; }
  340. sub LOCALE_SABBREVDAYNAME3          { 0x0033; }
  341. sub LOCALE_SABBREVDAYNAME4          { 0x0034; }
  342. sub LOCALE_SABBREVDAYNAME5          { 0x0035; }
  343. sub LOCALE_SABBREVDAYNAME6          { 0x0036; }
  344. sub LOCALE_SABBREVDAYNAME7          { 0x0037; }
  345. sub LOCALE_SMONTHNAME1              { 0x0038; }
  346. sub LOCALE_SMONTHNAME2              { 0x0039; }
  347. sub LOCALE_SMONTHNAME3              { 0x003A; }
  348. sub LOCALE_SMONTHNAME4              { 0x003B; }
  349. sub LOCALE_SMONTHNAME5              { 0x003C; }
  350. sub LOCALE_SMONTHNAME6              { 0x003D; }
  351. sub LOCALE_SMONTHNAME7              { 0x003E; }
  352. sub LOCALE_SMONTHNAME8              { 0x003F; }
  353. sub LOCALE_SMONTHNAME9              { 0x0040; }
  354. sub LOCALE_SMONTHNAME10             { 0x0041; }
  355. sub LOCALE_SMONTHNAME11             { 0x0042; }
  356. sub LOCALE_SMONTHNAME12             { 0x0043; }
  357. sub LOCALE_SMONTHNAME13             { 0x100E; }
  358. sub LOCALE_SABBREVMONTHNAME1        { 0x0044; }
  359. sub LOCALE_SABBREVMONTHNAME2        { 0x0045; }
  360. sub LOCALE_SABBREVMONTHNAME3        { 0x0046; }
  361. sub LOCALE_SABBREVMONTHNAME4        { 0x0047; }
  362. sub LOCALE_SABBREVMONTHNAME5        { 0x0048; }
  363. sub LOCALE_SABBREVMONTHNAME6        { 0x0049; }
  364. sub LOCALE_SABBREVMONTHNAME7        { 0x004A; }
  365. sub LOCALE_SABBREVMONTHNAME8        { 0x004B; }
  366. sub LOCALE_SABBREVMONTHNAME9        { 0x004C; }
  367. sub LOCALE_SABBREVMONTHNAME10       { 0x004D; }
  368. sub LOCALE_SABBREVMONTHNAME11       { 0x004E; }
  369. sub LOCALE_SABBREVMONTHNAME12       { 0x004F; }
  370. sub LOCALE_SABBREVMONTHNAME13       { 0x100F; }
  371. sub LOCALE_SPOSITIVESIGN            { 0x0050; }
  372. sub LOCALE_SNEGATIVESIGN            { 0x0051; }
  373. sub LOCALE_IPOSSIGNPOSN             { 0x0052; }
  374. sub LOCALE_INEGSIGNPOSN             { 0x0053; }
  375. sub LOCALE_IPOSSYMPRECEDES          { 0x0054; }
  376. sub LOCALE_IPOSSEPBYSPACE           { 0x0055; }
  377. sub LOCALE_INEGSYMPRECEDES          { 0x0056; }
  378. sub LOCALE_INEGSEPBYSPACE           { 0x0057; }
  379.  
  380. # Language Identifier Functions
  381. sub MAKELANGID       { my ($p,$s) = @_; (($s & 0xffff) << 10) | ($p & 0xffff); }
  382. sub PRIMARYLANGID  { my $lgid = shift; $lgid & 0x3ff; }
  383. sub SUBLANGID       { my $lgid = shift; ($lgid >> 10) & 0x3f; }
  384.  
  385. sub LANG_SYSTEM_DEFAULT { MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT); }
  386. sub LANG_USER_DEFAULT   { MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); }
  387.  
  388. # Locale Identifier Functions
  389. sub MAKELCID       { my $lgid = shift; $lgid & 0xffff; }
  390. sub LANGIDFROMLCID { my $lcid = shift; $lcid & 0xffff; }
  391.  
  392. sub LOCALE_SYSTEM_DEFAULT { MAKELCID(LANG_SYSTEM_DEFAULT); }
  393. sub LOCALE_USER_DEFAULT   { MAKELCID(LANG_USER_DEFAULT); }
  394.  
  395. 1;
  396.  
  397. __END__
  398.  
  399. =head1 NAME
  400.  
  401. Win32::OLE::NLS - OLE National Language Support
  402.  
  403. =head1 SYNOPSIS
  404.  
  405.     missing
  406.  
  407. =head1 DESCRIPTION
  408.  
  409. This module provides access to the national language support features
  410. in the OLENLS.DLL.
  411.  
  412. =head2 Functions
  413.  
  414. =over 8
  415.  
  416. =item CompareString(LCID,FLAGS,STR1,STR2)
  417.  
  418. Compare STR1 and STR2 in the LCID locale. FLAGS indicate the character
  419. traits to be used or ignored when comparing the two strings.
  420.  
  421.     NORM_IGNORECASE        Ignore case
  422.     NORM_IGNOREKANATYPE    Ignore hiragana/katakana character differences
  423.     NORM_IGNORENONSPACE    Ignore accents, diacritics, and vowel marks
  424.     NORM_IGNORESYMBOLS    Ignore symbols
  425.     NORM_IGNOREWIDTH    Ignore character width
  426.  
  427. Possible return values are:
  428.  
  429.     0    Function failed
  430.     1    STR1 is less than STR2
  431.     2    STR1 is equal to STR2
  432.     3    STR1 is greater than STR2
  433.  
  434. Note that you can subtract 2 from the return code to get values 
  435. comparable to the C<cmp> operator.
  436.  
  437. =item LCMapString(LCID,FLAGS,STR)
  438.  
  439. LCMapString translates STR using LCID dependent translation.
  440. Flags contains a combination of the following options:
  441.  
  442.     LCMAP_LOWERCASE        Lowercase
  443.     LCMAP_UPPERCASE        Uppercase
  444.     LCMAP_HALFWIDTH        Narrow characters
  445.     LCMAP_FULLWIDTH        Wide characters
  446.     LCMAP_HIRAGANA        Hiragana
  447.     LCMAP_KATAKANA        Katakana
  448.     LCMAP_SORTKEY        Character sort key
  449.  
  450. The following normalization options can be combined with C<LCMAP_SORTKEY>:
  451.  
  452.     NORM_IGNORECASE        Ignore case
  453.     NORM_IGNOREKANATYPE    Ignore hiragana/katakana character differences
  454.     NORM_IGNORENONSPACE    Ignore accents, diacritics, and vowel marks
  455.     NORM_IGNORESYMBOLS    Ignore symbols
  456.     NORM_IGNOREWIDTH    Ignore character width
  457.  
  458. The return value is the translated string.
  459.  
  460. =item GetLocaleInfo(LCID,LCTYPE)
  461.  
  462. Retrieve locale setting LCTYPE from the locale specified by LCID. Use
  463. LOCALE_NOUSEROVERRIDE | LCTYPE to always query the locale database.
  464. Otherwise user changes to C<win.ini> through the windows control panel
  465. take precedence when retrieving values for the system default locale.
  466. See the documentation below for a list of valid LCTYPE values.
  467.  
  468. The return value is the contents of the requested locale setting.
  469.  
  470. =item GetStringType(LCID,TYPE,STR)
  471.  
  472. Retrieve type information from locale LCID about each character in STR.
  473. The requested TYPE can be one of the following 3 levels:
  474.  
  475.     CT_CTYPE1        ANSI C and POSIX type information
  476.     CT_CTYPE2        Text layout type information
  477.     CT_CTYPE3        Text processing type information
  478.  
  479. The return value is a list of values, each of wich is a bitwise OR of
  480. the applicable type bits from the corresponding table below:
  481.  
  482.     @ct = GetStringInfo(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, "String");
  483.  
  484. ANSI C and POSIX character type information:
  485.  
  486.     C1_UPPER        Uppercase
  487.     C1_LOWER        Lowercase
  488.     C1_DIGIT        Decimal digits
  489.     C1_SPACE        Space characters
  490.     C1_PUNCT        Punctuation
  491.     C1_CNTRL        Control characters
  492.     C1_BLANK        Blank characters
  493.     C1_XDIGIT        Hexadecimal digits
  494.     C1_ALPHA        Any letter
  495.  
  496. Text layout type information:
  497.  
  498.     C2_LEFTTORIGHT        Left to right
  499.     C2_RIGHTTOLEFT        Right to left
  500.     C2_EUROPENUMBER        European number, European digit
  501.     C2_EUROPESEPARATOR    European numeric separator
  502.     C2_EUROPETERMINATOR    European numeric terminator
  503.     C2_ARABICNUMBER        Arabic number
  504.     C2_COMMONSEPARATOR    Common numeric separator
  505.     C2_BLOCKSEPARATOR    Block separator
  506.     C2_SEGMENTSEPARATOR    Segment separator
  507.     C2_WHITESPACE        White space
  508.     C2_OTHERNEUTRAL        Other neutrals
  509.     C2_NOTAPPLICABLE    No implicit direction (e.g. ctrl codes)
  510.  
  511. Text precessing type information:
  512.  
  513.     C3_NONSPACING        Nonspacing mark
  514.     C3_DIACRITIC        Diacritic nonspacing mark
  515.     C3_VOWELMARK        Vowel nonspacing mark
  516.     C3_SYMBOL        Symbol
  517.     C3_KATAKANA        Katakana character
  518.     C3_HIRAGANA        Hiragana character
  519.     C3_HALFWIDTH        Narrow character
  520.     C3_FULLWIDTH        Wide character
  521.     C3_IDEOGRAPH        Ideograph
  522.     C3_ALPHA        Any letter
  523.     C3_NOTAPPLICABLE    Not applicable
  524.  
  525.  
  526. =item GetSystemDefaultLangID()
  527.  
  528. Returns the system default language identifier.
  529.  
  530. =item GetSystemDefaultLCID()
  531.  
  532. Returns the system default locale identifier.
  533.  
  534. =item GetUserDefaultLangID()
  535.  
  536. Returns the user default language identifier.
  537.  
  538. =item GetUserDefaultLCID()
  539.  
  540. Returns the user default locale identifier.
  541.  
  542. =item MAKELANGID(LANG,SUBLANG)
  543.  
  544. Creates a lnguage identifier from a primary language and a sublanguage.
  545.  
  546. =item PRIMARYLANGID(LANGID)
  547.  
  548. Retrieves the primary language from a language identifier.
  549.  
  550. =item SUBLANGID(LANGID)
  551.  
  552. Retrieves the sublanguage from a language identifier.
  553.  
  554. =item MAKELCID(LANGID)
  555.  
  556. Creates a locale identifies from a language identifier.
  557.  
  558. =item LANGIDFROMLCID(LCID)
  559.  
  560. Retrieves a language identifier from a locale identifier.
  561.  
  562. =back
  563.  
  564. =head2 Locale Types
  565.  
  566. =over 8
  567.  
  568. =item LOCALE_ILANGUAGE
  569.  
  570. The language identifier (in hex).
  571.  
  572. =item LOCALE_SLANGUAGE
  573.  
  574. The localized name of the language.
  575.  
  576. =item LOCALE_SENGLANGUAGE
  577.  
  578. The ISO Standard 639 English name of the language.
  579.  
  580. =item LOCALE_SABBREVLANGNAME
  581.  
  582. The three-letter abbreviated name of the language. The first two
  583. letters are from the ISO Standard 639 language name abbreviation. The
  584. third letter indicates the sublanguage type.
  585.  
  586. =item LOCALE_SNATIVELANGNAME
  587.  
  588. The native name of the language.
  589.  
  590. =item LOCALE_ICOUNTRY
  591.  
  592. The country code, which is based on international phone codes.
  593.  
  594. =item LOCALE_SCOUNTRY
  595.  
  596. The localized name of the country.
  597.  
  598. =item LOCALE_SENGCOUNTRY
  599.  
  600. The English name of the country.
  601.  
  602. =item LOCALE_SABBREVCTRYNAME
  603.  
  604. The ISO Standard 3166 abbreviated name of the country.
  605.  
  606. =item LOCALE_SNATIVECTRYNAME
  607.  
  608. The native name of the country.
  609.  
  610. =item LOCALE_IDEFAULTLANGUAGE
  611.  
  612. Language identifier for the principal language spoken in this
  613. locale.
  614.  
  615. =item LOCALE_IDEFAULTCOUNTRY
  616.  
  617. Country code for the principal country in this locale.
  618.  
  619. =item LOCALE_IDEFAULTANSICODEPAGE
  620.  
  621. The ANSI code page associated with this locale. Format: 4 Unicode
  622. decimal digits plus a Unicode null terminator.
  623.  
  624. XXX This should be translated by GetLocaleInfo. XXX
  625.  
  626. =item LOCALE_IDEFAULTCODEPAGE
  627.  
  628. The OEM code page associated with the country.
  629.  
  630. =item LOCALE_SLIST
  631.  
  632. Characters used to separate list items (often a comma).
  633.  
  634. =item LOCALE_IMEASURE
  635.  
  636. Default measurement system:
  637.  
  638.     0    metric system (S.I.)
  639.     1    U.S. system
  640.  
  641. =item LOCALE_SDECIMAL
  642.  
  643. Characters used for the decimal separator (often a dot).
  644.  
  645. =item LOCALE_STHOUSAND
  646.  
  647. Characters used as the separator between groups of digits left of the decimal.
  648.  
  649. =item LOCALE_SGROUPING
  650.  
  651. Sizes for each group of digits to the left of the decimal. An explicit
  652. size is required for each group. Sizes are separated by semicolons. If
  653. the last value is 0, the preceding value is repeated. To group
  654. thousands, specify 3;0.
  655.  
  656. =item LOCALE_IDIGITS
  657.  
  658. The number of fractional digits.
  659.  
  660. =item LOCALE_ILZERO
  661.  
  662. Whether to use leading zeros in decimal fields. A setting of 0
  663. means use no leading zeros; 1 means use leading zeros.
  664.  
  665. =item LOCALE_SNATIVEDIGITS
  666.  
  667. The ten characters that are the native equivalent of the ASCII 0-9.
  668.  
  669. =item LOCALE_INEGNUMBER
  670.  
  671. Negative number mode. 
  672.  
  673.     0     (1.1)
  674.     1     -1.1
  675.     2     -1.1
  676.     3     1.1
  677.     4     1.1
  678.  
  679. =item LOCALE_SCURRENCY
  680.  
  681. The string used as the local monetary symbol.
  682.  
  683. =item LOCALE_SINTLSYMBOL
  684.  
  685. Three characters of the International monetary symbol specified in ISO
  686. 4217, Codes for the Representation of Currencies and Funds, followed
  687. by the character separating this string from the amount.
  688.  
  689. =item LOCALE_SMONDECIMALSEP
  690.  
  691. Characters used for the monetary decimal separators.
  692.  
  693. =item LOCALE_SMONTHOUSANDSEP
  694.  
  695. Characters used as monetary separator between groups of digits left of
  696. the decimal.
  697.  
  698. =item LOCALE_SMONGROUPING
  699.  
  700. Sizes for each group of monetary digits to the left of the decimal. An
  701. explicit size is needed for each group. Sizes are separated by
  702. semicolons. If the last value is 0, the preceding value is
  703. repeated. To group thousands, specify 3;0.
  704.  
  705. =item LOCALE_ICURRDIGITS
  706.  
  707. Number of fractional digits for the local monetary format.
  708.  
  709. =item LOCALE_IINTLCURRDIGITS
  710.  
  711. Number of fractional digits for the international monetary format.
  712.  
  713. =item LOCALE_ICURRENCY
  714.  
  715. Positive currency mode. 
  716.  
  717.     0    Prefix, no separation.
  718.     1    Suffix, no separation.
  719.     2    Prefix, 1-character separation.
  720.     3    Suffix, 1-character separation.
  721.  
  722. =item LOCALE_INEGCURR
  723.  
  724. Negative currency mode. 
  725.  
  726.     0    ($1.1)
  727.     1    -$1.1
  728.     2    $-1.1
  729.     3    $1.1-
  730.     4    $(1.1$)
  731.     5    -1.1$
  732.     6    1.1-$
  733.     7    1.1$-
  734.     8    -1.1 $ (space before $)
  735.     9    -$ 1.1 (space after $)
  736.     10    1.1 $- (space before $)
  737.  
  738. =item LOCALE_ICALENDARTYPE
  739.  
  740. The type of calendar currently in use. 
  741.  
  742.     1    Gregorian (as in U.S.)
  743.     2    Gregorian (always English strings)
  744.     3    Era: Year of the Emperor (Japan)
  745.     4    Era: Year of the Republic of China
  746.     5    Tangun Era (Korea)
  747.  
  748. =item LOCALE_IOPTIONALCALENDAR
  749.  
  750. The additional calendar types available for this LCID. Can be a
  751. null-separated list of all valid optional calendars. Value is
  752. 0 for "None available" or any of the LOCALE_ICALENDARTYPE settings.
  753.  
  754. XXX null separated list should be translated by GetLocaleInfo XXX
  755.  
  756. =item LOCALE_SDATE
  757.  
  758. Characters used for the date separator.
  759.  
  760. =item LOCALE_STIME
  761.  
  762. Characters used for the time separator.
  763.  
  764. =item LOCALE_STIMEFORMAT
  765.  
  766. Time-formatting string.
  767.  
  768. =item LOCALE_SSHORTDATE
  769.  
  770. Short Date_Time formatting strings for this locale.
  771.  
  772. =item LOCALE_SLONGDATE
  773.  
  774. Long Date_Time formatting strings for this locale.
  775.  
  776. =item LOCALE_IDATE
  777.  
  778. Short Date format-ordering specifier.
  779.  
  780.     0    Month - Day - Year
  781.     1    Day - Month - Year
  782.     2    Year - Month - Day
  783.  
  784. =item LOCALE_ILDATE
  785.  
  786. Long Date format ordering specifier. Value can be any of the valid
  787. LOCALE_IDATE settings.
  788.  
  789. =item LOCALE_ITIME
  790.  
  791. Time format specifier.
  792.  
  793.     0    AM/PM 12-hour format.
  794.     1    24-hour format.
  795.  
  796. =item LOCALE_ITIMEMARKPOSN
  797.  
  798. Whether the time marker string (AM|PM) precedes or follows the time
  799. string.
  800.     0 Suffix (9:15 AM).
  801.     1 Prefix (AM 9:15).
  802.  
  803. =item LOCALE_ICENTURY
  804.  
  805. Whether to use full 4-digit century.
  806.  
  807.     0    Two digit.
  808.     1    Full century.
  809.  
  810. =item LOCALE_ITLZERO
  811.  
  812. Whether to use leading zeros in time fields.
  813.  
  814.     0    No leading zeros.
  815.     1    Leading zeros for hours.
  816.  
  817. =item LOCALE_IDAYLZERO
  818.  
  819. Whether to use leading zeros in day fields. Values as for
  820. LOCALE_ITLZERO.
  821.  
  822. =item LOCALE_IMONLZERO
  823.  
  824. Whether to use leading zeros in month fields. Values as for
  825. LOCALE_ITLZERO.
  826.  
  827. =item LOCALE_S1159
  828.  
  829. String for the AM designator.
  830.  
  831. =item LOCALE_S2359
  832.  
  833. String for the PM designator.
  834.  
  835. =item LOCALE_IFIRSTWEEKOFYEAR
  836.  
  837. Specifies which week of the year is considered first.
  838.  
  839.     0    Week containing 1/1 is the first week of the year.
  840.     1    First full week following 1/1is the first week of the year.
  841.     2    First week with at least 4 days is the first week of the year.
  842.  
  843. =item LOCALE_IFIRSTDAYOFWEEK
  844.  
  845. Specifies the day considered first in the week. Value "0" means
  846. SDAYNAME1 and value "6" means SDAYNAME7.
  847.  
  848. =item LOCALE_SDAYNAME1 .. LOCALE_SDAYNAME7
  849.  
  850. Long name for Monday .. Sunday.
  851.  
  852. =item LOCALE_SABBREVDAYNAME1 .. LOCALE_SABBREVDAYNAME7
  853.  
  854. Abbreviated name for Monday .. Sunday.
  855.  
  856. =item LOCALE_SMONTHNAME1 .. LOCALE_SMONTHNAME12
  857.  
  858. Long name for January .. December.
  859.  
  860. =item LOCALE_SMONTHNAME13
  861.  
  862. Native name for 13th month, if it exists.
  863.  
  864. =item LOCALE_SABBREVMONTHNAME1 .. LOCALE_SABBREVMONTHNAME12
  865.  
  866. Abbreviated name for January .. December.
  867.  
  868. =item LOCALE_SABBREVMONTHNAME13
  869.  
  870. Native abbreviated name for 13th month, if it exists.
  871.  
  872. =item LOCALE_SPOSITIVESIGN
  873.  
  874. String value for the positive sign.
  875.  
  876. =item LOCALE_SNEGATIVESIGN
  877.  
  878. String value for the negative sign.
  879.  
  880. =item LOCALE_IPOSSIGNPOSN
  881.  
  882. Formatting index for positive values.
  883.  
  884.     0 Parentheses surround the amount and the monetary symbol.
  885.     1 The sign string precedes the amount and the monetary symbol.
  886.     2 The sign string precedes the amount and the monetary symbol.
  887.     3 The sign string precedes the amount and the monetary symbol.
  888.     4 The sign string precedes the amount and the monetary symbol.
  889.  
  890. =item LOCALE_INEGSIGNPOSN
  891.  
  892. Formatting index for negative values. Values as for LOCALE_IPOSSIGNPOSN.
  893.  
  894. =item LOCALE_IPOSSYMPRECEDES
  895.  
  896. If the monetary symbol precedes, 1. If it succeeds a positive amount, 0.
  897.  
  898. =item LOCALE_IPOSSEPBYSPACE
  899.  
  900. If the monetary symbol is separated by a space from a positive amount,
  901. 1. Otherwise, 0.
  902.  
  903. =item LOCALE_INEGSYMPRECEDES
  904.  
  905. If the monetary symbol precedes, 1. If it succeeds a negative amount, 0.
  906.  
  907. =item LOCALE_INEGSEPBYSPACE
  908.  
  909. If the monetary symbol is separated by a space from a negative amount,
  910. 1. Otherwise, 0.
  911.  
  912. =back
  913.  
  914. =head1 AUTHORS/COPYRIGHT
  915.  
  916. This module is part of the Win32::OLE distribution.
  917.  
  918. =cut
  919.